<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript">
        window.onload=function()
        {
            //声明Map
            let m=new Map();
            console.log(m);
            //添加元素
            m.set("name","尚硅谷");
            m.set("change","我们可以改变世界");
            let key=
            {
                school:"ATGUIGU"
            };
            m.set(key,["北京","上海"]);
            console.log(m);
            console.log(m.size);
            //删除元素
            m.delete("name");
            console.log(m);
            //获取元素
            console.log(m.get(key));
            //清空元素
            /*
            m.clear();
            console.log(m);
            */
            //遍历
            for(let v of m)
            {
                console.log(v);
            }
        };
    </script>
</head>
<body>
    
</body>
</html>